<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="tangs" uri="/WEB-INF/tangs.tld"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
	<title>受付履歴</title>
    
	<s:head/>
<tangs:head/>
<script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery.cleardefault.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery.tablesorter.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery.systemCommon.js"></script>
  
  
 <script language='javascript'>
$(document).ready(function()
    {
       $("#table").tablesorter(
         {
           headers: { 0: { sorter: false}, 1: {sorter: false}}
           ,fix:1
           }
        );

       //var t = new ScrollableTable(document.getElementById('table'), 160);
       
       	$("#table input:radio").click( function () {
       		$('#delButton').attr("disabled",false);
       		$('#editButton').attr("disabled",false);
       		$('#grid_id_ukeYmd').val($(this).parent().parent().children("td").eq($('#grid_id_ukeYmd_index').val()).text());
$('#grid_id_ksNo').val($(this).parent().parent().children("td").eq($('#grid_id_ksNo_index').val()).text());
$('#grid_id_seq').val($(this).parent().parent().children("td").eq($('#grid_id_seq_index').val()).text());

			
		});
    }
);

 $.subscribe('getObjSuccess', function(event,data) {
    
     $('#tdukerrk_id_ukeYmd').attr('value','');
$('#tdukerrk_id_ukeYmd').attr('value',event.originalEvent.data.obj.id.ukeYmd);
$('#tdukerrk_id_ksNo').attr('value','');
$('#tdukerrk_id_ksNo').attr('value',event.originalEvent.data.obj.id.ksNo);
$('#tdukerrk_id_seq').attr('value','');
$('#tdukerrk_id_seq').attr('value',event.originalEvent.data.obj.id.seq);
$('#tdukerrk_zsNm').attr('value','');
$('#tdukerrk_zsNm').attr('value',event.originalEvent.data.obj.zsNm);
$('#tdukerrk_updZVlu').attr('value','');
$('#tdukerrk_updZVlu').attr('value',event.originalEvent.data.obj.updZVlu);
$('#tdukerrk_updGVlu').attr('value','');
$('#tdukerrk_updGVlu').attr('value',event.originalEvent.data.obj.updGVlu);

 });

function del(){
	document.getElementById('ListForm').action='<%=request.getContextPath()%>/master/tdukerrkMst-del.do';
	document.getElementById('ListForm').submit();
}

function newMst(){
	document.getElementById('ListForm').action='<%=request.getContextPath()%>/master/tdukerrkMst.do';
	document.getElementById('ListForm').submit();

}
</script>
  
  </head>
  
  <body>
  
    <div id="main">
    <h1 class="title1">受付履歴</h1>
    <div class="Yscroll" style="width: 1000px; height: 190px; border: 1px #ddd solid;">
				<s:form id="ListForm" action="tdukerrkmast-getObj" theme="simple">
		<tangs:grid id="table" width="1200px" cssClass="tablesorter"  page="compageData">
			<tangs:column width="20px" type="radio" title="&nbsp;" name="rad" cssClass="empty2"/>
			<tangs:column width="40px" type="serial" title="番号"/>
			<tangs:column width="200px" property="id.ukeYmd" title="受付日"/>
			<tangs:column width="200px" property="id.ksNo" title="検査番号"/>
			<tangs:column width="200px" property="id.seq" title="行番号"/>
			<tangs:column width="200px" property="zsNm" title="属性名"/>
			<tangs:column width="200px" property="updZVlu" title="更新前値"/>
			<tangs:column width="200px" property="updGVlu" title="更新後値"/>
		</tangs:grid >
<input type="hidden" name="objId.ukeYmd" id="grid_id_ukeYmd" style="display:none"></input>
<input type="hidden" name="objId.ksNo" id="grid_id_ksNo" style="display:none"></input>
<input type="hidden" name="objId.seq" id="grid_id_seq" style="display:none"></input>
		</s:form>

	</div>
	
    <div id="container" class="ui-widget-content" style="width: 980px;">
    	<div id="mstBut">
			<input type="button" id="newButton" value="新規" class="button"  onclick="javascript:newMst();"/>
			<sj:submit  formIds="ListForm" id="editButton"
				   			            targets="json" dataType="json" 
				   			            onSuccessTopics="getObjSuccess"
				   			            value="編集" cssClass="button" disabled="true"/>
			<tangs:dialog id="delButton" msg="受付履歴 を削除します。よろしいですか？" confirm="true" cssClass="button" disabled="true" openButtonname="削除" okFunction="del()" focusOn="1"></tangs:dialog>	
    	</div>
    
    <s:form id="editForm" action="tdukerrkMst-save" theme="simple">
    
    	<table id="fieldTable">
		<tr>
			<td class="fieldItem">受付日:</td><td class="fieldValue"><sj:datepicker id='tdukerrk_id_ukeYmd' changeMonth='true' changeYear='true' size='8' cssClass='datepicker' showOn='focus' cssStyle='ime-mode: inactive' displayFormat='yymmdd'  name='tdukerrk.id.ukeYmd' /> </td>
			<td class="fieldItem">検査番号:</td><td class="fieldValue"><s:textfield id='tdukerrk_id_ksNo'name='tdukerrk.id.ksNo' /> </td>
		</tr>
		<tr>
			<td class="fieldItem">行番号:</td><td class="fieldValue"><s:textfield id='tdukerrk_id_seq'name='tdukerrk.id.seq' /> </td>
			<td class="fieldItem">属性名:</td><td class="fieldValue"><s:textfield id='tdukerrk_zsNm'name='tdukerrk.zsNm' /> </td>
		</tr>
		<tr>
			<td class="fieldItem">更新前値:</td><td class="fieldValue"><s:textfield id='tdukerrk_updZVlu'name='tdukerrk.updZVlu' /> </td>
			<td class="fieldItem">更新後値:</td><td class="fieldValue"><s:textfield id='tdukerrk_updGVlu'name='tdukerrk.updGVlu' /> </td>
		</tr>
	</table>


	<div style="text-align: right; margin-right: 40px;">
    <img id="indicator3" src="<%=request.getContextPath()%>/images/indicator.gif" alt="Loading..." style="display:none"/>
	      				 	<s:url action="tdukerrkMst-check" id="saveUrl"></s:url>
				   			<sj:a formIds="editForm" id="checkButton" href="%{saveUrl}" targets="commonfielderror" button="true" indicator="indicator3"  onSuccessTopics="commonfielderror">登録</sj:a>
							<s:submit action="tdukerrkMst-save" theme="simple" id="saveButton" cssClass="button" cssStyle="display:none"  value="登録"></s:submit>
				 			
	</div>						      
							      </s:form>
  </div>
 <tangs:fielderror successTopics="commonfielderror" okButtonId="saveButton"></tangs:fielderror>
  </div>
  </body>
</html>
